$(function(){
	var $y_SideNavleft=$("#y_Nav").offset().left;
	$("#y_SideNavBox").css("left",$y_SideNavleft + "px");
	var $y_SideRightBoxLeft=$y_SideNavleft+1210;
	var $y_SideRightBoxLeft1=$y_SideNavleft+1201;
	//var $y_SideRightBoxLeft2=$y_SideNavleft+1201-575;
	var $y_SideRightBoxLeft2=$y_SideNavleft+1210-575;

	var $y_WinWidth=$(window).width();

	if ($y_WinWidth>=1310) {
		$("#y_SideRightBox").css("left",$y_SideRightBoxLeft + "px");
		$("#y_SideRightBox2").css("left",$y_SideRightBoxLeft2 + "px");


	} else if ($y_WinWidth<1310) {
		$("#y_SideRightBox").css("right","0");
		$("#y_SideRightBox2").css("right","80");


	}


	$(window).resize(function(){
		var $y_SideNavleft=$("#y_Nav").offset().left;
		$("#y_SideNavBox").css("left",$y_SideNavleft + "px");
		var $y_SideRightBoxLeft=$y_SideNavleft+1210;
		var $y_SideRightBoxLeft1=$y_SideNavleft+1201;
		var $y_SideRightBoxLeft2=$y_SideNavleft+1210-575;
		var $y_WinWidth=$(window).width();

		if ($y_WinWidth>=1310) {
			$("#y_SideRightBox").css("left",$y_SideRightBoxLeft + "px");
			$("#y_SideRightBox2").css("left",$y_SideRightBoxLeft2 + "px");

		} else if ($y_WinWidth<1310) {
			$("#y_SideRightBox").css("right","0");
			$("#y_SideRightBox2").css("right","80");

		}
	});

    setTimeout(function(){
        // $("#y_Call1").animate({left:"+=570px"},300);
        setTimeout(function(){
            $("#y_SideRightBox2").css("display","none");
            $("#y_CallHov").hover(function(){
                if (!$("#y_call").is(":animated")) {
                    $("#y_SideRightBox1").css("display","block");
                    $("#y_Call").animate({left:"-=570px"},300);
                };
            },function(){
                if (!$("#y_call").is(":animated")) {
                    $("#y_Call").animate({left:"+=570px"},300);
                    setTimeout(function(){
                        $("#y_SideRightBox1").css("display","none");
                    },310);
                };
            });
        },310);





    },5000);


    $(document).one("click",function(){
        $("#y_Call1").animate({left:"+=570px"},300);
        setTimeout(function(){
            $("#y_SideRightBox2").css("display","none");

            $("#y_CallHov").hover(function(){
                if (!$("#y_call").is(":animated")) {
                    $("#y_SideRightBox1").css("display","block");
                    $("#y_Call").animate({left:"-=570px"},300);
                };
            },function(){
                if (!$("#y_call").is(":animated")) {
                    $("#y_Call").animate({left:"+=570px"},300);
                    setTimeout(function(){
                        $("#y_SideRightBox1").css("display","none");
                    },310);
                };
            });
        },310);
    });

    //FOOTER公众号HOVER
			$("#yFooterC1b4t2").hover(function(){
				//alert("11");
				$(this).attr("src","/image/home/y_p1footert3b.jpg");
				$("#yFooterC1b4t3").attr("src","/image/home/y_p1footert4a.jpg");
				$("#y_footCp").text("关注官方微博");
				$("#y_FooterC1b4t1").attr("src","/image/home/y_p1footert2b.jpg");
			},function(){
			});
			$("#yFooterC1b4t3").hover(function(){
				//alert("22");
				$(this).attr("src","/image/home/y_p1footert4b.jpg");
				$("#yFooterC1b4t2").attr("src","/image/home/y_p1footert3a.jpg");
				$("#y_footCp").text("关注官方微信");
				$("#y_FooterC1b4t1").attr("src","/image/home/y_p1footert2a.jpg");
			},function(){
			});




		});







		//beginning of y_diyFlashJs
		$(function(){

			//设置循环播放
			function bofang(){
				var $firstChild=$("#slideBox img:first-child");
				var $lastChild=$("#slideBox img:last-child");
				var $children=$("#slideBox").children();
				$lastChild.animate({left:"-=2000"},500,function(){
					$lastChild.insertBefore($firstChild);
					$children.css({"top":"0","left":"0"});
					var $slideTab=$("#slideBox img:last-child").attr("class");
					//$("#slideText p[class='"+$slideTab+"']").siblings().fadeOut();
					//$("#slideText p[class='"+$slideTab+"']").fadeIn();
					$("#buoys img[class='"+$slideTab+"']").attr("src","/image/home/y_p1b1t2.jpg").siblings().attr("src","/image/home/y_p1b1t3.jpg");
				});
			};
			movement=setInterval(bofang,5000);


			//图片说明部分
			var $boxoneHight=$("#slideBox img").height();
			$("#slideBox").css("height",$boxoneHight + "px");
			$("#slideAllBox").css("height",$boxoneHight + "px");


			//点击事件
			$("#y_slibiaoT1").click(function(){
				clearInterval(movement);
				$("#buoys img[class='slideText1']").attr("src","/image/home/y_p1b1t2.jpg").siblings().attr("src","/image/home/y_p1b1t3.jpg");
				var $lastChild=$("#slideBox img:last-child");
				$("#y_slideT1").hide().insertAfter($lastChild).fadeIn();
				$("#y_slideT2").insertBefore($("#y_slideT1"));
				$("#y_slideT3").insertBefore($("#y_slideT2"));
				movement=setInterval(bofang,5000);

			});
			$("#y_slibiaoT2").click(function(){
				clearInterval(movement);
				$("#buoys img[class='slideText2']").attr("src","/image/home/y_p1b1t2.jpg").siblings().attr("src","/image/home/y_p1b1t3.jpg");
				var $lastChild=$("#slideBox img:last-child");
				$("#y_slideT2").hide().insertAfter($lastChild).fadeIn();
				$("#y_slideT3").insertBefore($("#y_slideT2"));
				$("#y_slideT1").insertBefore($("#y_slideT3"));
				movement=setInterval(bofang,5000);

			});
			$("#y_slibiaoT3").click(function(){
				clearInterval(movement);
				$("#buoys img[class='slideText3']").attr("src","/image/home/y_p1b1t2.jpg").siblings().attr("src","/image/home/y_p1b1t3.jpg");
				var $lastChild=$("#slideBox img:last-child");
				$("#y_slideT3").hide().insertAfter($lastChild).fadeIn();
				$("#y_slideT1").insertBefore($("#y_slideT3"));
				$("#y_slideT2").insertBefore($("#y_slideT1"));
				movement=setInterval(bofang,5000);

			});


			//左侧固定部分
			$("#y_SideNav2").css("background-color","#292929");
			$("#y_2a").css("color","white");
			$("#y_2b").css("color","#838383");
			$("#y_2c a").css("color","white");
			$("#y_1a").css("color","#0e0e0e");
			$("#y_1b").css("color","#0e0e0e");
			$("#y_1c a").css("color","#0e0e0e");
			$("#y_3a").css("color","#0e0e0e");
			$("#y_3b").css("color","#0e0e0e");
			$("#y_3c a").css("color","#0e0e0e");

			$("#y_SideNav1").hover(function(){
				$(this).css("background-color","#292929").siblings().css("background-color","#e3e4e8");
				$("#y_1a").css("color","white")
				$("#y_1b").css("color","#838383");
				$("#y_1c a").css("color","white");
				$("#y_2a").css("color","#0e0e0e");
				$("#y_2b").css("color","#0e0e0e");
				$("#y_2c a").css("color","#0e0e0e");
				$("#y_3a").css("color","#0e0e0e");
				$("#y_3b").css("color","#0e0e0e");
				$("#y_3c a").css("color","#0e0e0e");

			},function(){
				/*$(this).css("background-color","#e3e4e8");
				 $("#y_1a").css("color","#0e0e0e")
				 $("#y_1b").css("color","#0e0e0e");
				 $("#y_1c a").css("color","#0e0e0e");*/

			});
			$("#y_SideNav2").hover(function(){
				$(this).css("background-color","#292929").siblings().css("background-color","#e3e4e8");
				$("#y_2a").css("color","white")
				$("#y_2b").css("color","#838383");
				$("#y_2c a").css("color","white");
				$("#y_1a").css("color","#0e0e0e");
				$("#y_1b").css("color","#0e0e0e");
				$("#y_1c a").css("color","#0e0e0e");
				$("#y_3a").css("color","#0e0e0e");
				$("#y_3b").css("color","#0e0e0e");
				$("#y_3c a").css("color","#0e0e0e");

			},function(){
				/*$(this).css("background-color","#e3e4e8");
				 $("#y_2a").css("color","#0e0e0e")
				 $("#y_2b").css("color","#0e0e0e");
				 $("#y_2c a").css("color","#0e0e0e");*/


			});
			$("#y_SideNav3").hover(function(){
				$(this).css("background-color","#292929").siblings().css("background-color","#e3e4e8");
				$("#y_3a").css("color","white")
				$("#y_3b").css("color","#838383");
				$("#y_3c a").css("color","white");
				$("#y_2a").css("color","#0e0e0e");
				$("#y_2b").css("color","#0e0e0e");
				$("#y_2c a").css("color","#0e0e0e");
				$("#y_1a").css("color","#0e0e0e");
				$("#y_1b").css("color","#0e0e0e");
				$("#y_1c a").css("color","#0e0e0e");

			},function(){
				/*$(this).css("background-color","#e3e4e8");
				 $("#y_3a").css("color","#0e0e0e")
				 $("#y_3b").css("color","#0e0e0e");
				 $("#y_3c a").css("color","#0e0e0e");*/

			});

			$("#y_1c li").hover(function(){

				$(this).children().css("color","#ff5a00").parent().siblings().children().css("color","white");

			},function(){

			});
			$("#y_2c li").hover(function(){

				$(this).children().css("color","#ff5a00").parent().siblings().children().css("color","white");

			},function(){

			});
			$("#y_3c li").hover(function(){

				$(this).children().css("color","#ff5a00").parent().siblings().children().css("color","white");

			},function(){

			});



			$(window).scroll(function(){
				var winHigh=$(document).scrollTop();
				var dHigh=$(document).height();

				var winHjian=dHigh-1045;
				if (winHigh>winHjian) {
					$(".y_snbb").slideUp();
					$(".y_snb").slideUp();
				}else if(winHigh<winHjian){
					$(".y_snbb").slideDown();
					$(".y_snb").slideDown();
				}

			});









		});


		//end of y_diyFlashJs




/*beginning of y_casePage*/

/*$(function(){
 $("#y_caseB3P1Row1id li").click(function(){
 var $y_caseKey=$(this).attr("class");


 $("#y_caseB1P1R2bid ul[class='"+$y_caseKey+"']").show().siblings().hide();

 });
 });*/


$(function(){
	$(".y_caseB2Boxs").hover(function(){
		$(this).find(".y_caseB2Boxgai").show();
		//$(this).find(".y_caseB2Boxgai").fadeIn(100);
	},function(){
		$(this).find(".y_caseB2Boxgai").hide();
		//$(this).find(".y_caseB2Boxgai").fadeOut(100);
	});
});



/*end of y_casePage*/



